package com.atguigu.gulimall.product.service;

import com.atguigu.gulimall.product.entity.AttrGroupEntity;
import com.atguigu.gulimall.product.entity.ProductAttrValueEntity;
import com.atguigu.gulimall.product.vo.AttrGroupRelationVO;
import com.atguigu.gulimall.product.vo.AttrGroupWithAttrsVO;
import com.atguigu.gulimall.product.vo.AttrResponseVO;
import com.atguigu.gulimall.product.vo.AttrVO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.AttrEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author biubiu0002
 * @email 1007918011@qq.com
 * @date 2021-05-23 12:14:36
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveAttr(AttrVO attr);

    PageUtils queryList(Map<String, Object> params, Long categoryId,String type);

    AttrResponseVO getAttrInfo(Long attrId);

    void updateAttr(AttrVO attr);

    List<AttrEntity> getRelationAttr(Long groupId);

//    List<AttrVO> getRelationAttrVOs(Long groupId);

    void deleteRelation(List<AttrGroupRelationVO>  attrGroupRelationVOs);

    PageUtils getNoRelationAttr(Map<String, Object> params, Long attrGroupId);

    void saveRelation(List<AttrGroupRelationVO> attrGroupRelationVOs);

    List<AttrGroupWithAttrsVO> withAttr(Long catalogId);

    List<ProductAttrValueEntity> listForSpu(Long spuId);

    void updateSpu(Long spuId, List<ProductAttrValueEntity> entities);

    List<Long> selectSearchAttrIds(List<Long> attrIds);
}

